package  
{
	import adobe.utils.CustomActions;
	import flash.display.Sprite;
	/**
	 * ...
	 * @author Minfang
	 */
	public class TablePiece 
	{
		
		public var name:String;
		
		public var mask:Sprite;
		
		public var num_row:int;
		
		public var num_col:int;
		
		public var content:MatrixBox;
		
		public var mask_width:int,mask_height:int;
		

		
		public function TablePiece(na:String) 
		{
			name = na;
		}
		
		public function setEmptyCornor(rowNum:int,colNum:int) :void
		{
			
			mask = new Sprite;
			mask.x = mask.y = 10000;
			
			var con:Array=new Array();
			
			for (var i1:int = 0; i1 < rowNum; i1++) {
				
				var tt:Array = new Array;
				for (var i2:int = 0; i2 < colNum; i2++) {
					tt.push("");
				}
				con.push(tt);
			}
			
			content = new MatrixBox(con,null);
			content.mask = mask;
			num_row = content.getRowNumber();
			num_col = content.getColumnNumber();
		}
		
		
		
		public function setContent(dd:Object,textcss:String):void {
			
			
			
			
			
			mask = new Sprite;
			mask.x = mask.y = 10000;
			content = new MatrixBox(dd,textcss);
			content.mask = mask;
			num_row = content.getRowNumber();
			num_col = content.getColumnNumber();
		}
		
		public function printContentSize() :void{
			trace("Content size",name, "width:", content.width, " height:", content.height);
		}
		
		public function printMaskSize() :void{
			trace("Mask size",name, " x:",mask.x," y:",mask.y," width:", mask.width, " height:", mask.height);
		}
		
		
	}

}